<include file="Public:head_nosearch" />
	<main>
		<div class="form fillphone">
			
			<form action="{:U('login/savephone')}"  method="post" id="register">
					<h3>绑定微信账号</h3>
			<div style="text-align: center; line-height: 150%;">
				<img src="{$memberinfo.wx_headimgurl}"height="80" width="80" style="border-radius:50%">
			<p>昵称：{$memberinfo.wx_nickname}</p>
				<br />
			</div>
				
				<div class="inputbox">  
					<span class="iconfont tqk-yonghu1"></span>
					<input type="tel" name="phone" autocomplete="off" id="phone" placeholder="请输入您的手机号" />
				</div>
				<div class="inputbox">  
					<span class="iconfont tqk-bangding1"></span>
					<input type="text" name="invocode" autocomplete="off" id="invocode" placeholder="有邀请码请填写" />
				</div>
				<div class="inputbox">  
					<span class="iconfont tqk-password"></span>
					<input type="password" name="pwd" autocomplete="off" id="pwd" placeholder="请输入您的密码" />
				</div>
				<input type="hidden" name="openid" value="{$memberinfo.wx_openid}" />
				<input type="hidden" name="avatar" value="{$memberinfo.wx_headimgurl}" />
				<input type="hidden" name="nickname" value="{$memberinfo.wx_nickname}" />
				<input type="hidden" name="backurl" value="{$memberinfo.wx_callback}" />
				<input type="submit" value="确认绑定" class="am-btn btn-main am-radius am-btn-block"/>
			</form>
		</div>
	</main>
<include file="Public:foot" />
<script type="text/javascript">
			$("#register").validate({
				rules:{
					phone:{
						required: true,
					},
					pwd:{
						required: true,
					},
				},
				messages:{
					phone:{
						required: "请输入手机号",
					},
					pwd:{
						required: "请输入密码",
					},
				},
				submitHandler: function(form) 
			    {
					$(form).ajaxSubmit({
						success: function(json) {
							if(json.status == 1){
								layer.msg(json.msg, {icon:6});
								setTimeout(function(){
								window.location.href = "{$memberinfo.wx_callback}";
								},1000);
							}else{
								layer.msg(json.msg, {icon:5});
							}
			            }
					});     
			    }
			})
		</script>
	</body>
</html>
